﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="../lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
<link rel="stylesheet" href="../lib/zTree/v3/css/zTreeStyle/zTreeStyle.css" type="text/css">
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>免疫提示</title>
</head>
<body class="pos-r">

<div style="margin-left:1px;">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 生产管理 <span class="c-gray en">&gt;</span> 免疫提示 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="page-container">
		<div class="text-c">
		<input type="text" name="" id="cxts" placeholder=" 最近几天要免疫的" style="width:250px" class="input-text">
			<button name="" id="" class="btn btn-success" type="submit" onclick="select()"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
		</div>
		
		<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="r" id="zonggongshuju"> 共有数据：<strong>0</strong> 条</span> </div>
		<div class="mt-20">
		
			<table id="my" class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="40"><input name="" type="checkbox" value=""></th>
						<th width="70">免疫名称</th>
						<th width="60">疫苗名称</th>
						<th width="40">免疫类型</th>
						
						<th width="40">免疫日期</th>
						<th width="40">剩余天数</th>
						<th width="100">备注</th>
						<th width="100">注射人</th>
					</tr>
				</thead>
				<tbody>
					
				</tbody>
			</table>
		</div>
		
		<div id="page" style="text-align:right; margin-top:20px; margin-right:0px;">
		<span id="ago">上一页</span>
		<span class="page"><label id="pageCode"></label>/<label id="totalPage">0</label></span>
		<span id="next">下一页</span>
	</div>
</div>
<script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="../lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script> 
<script type="text/javascript" src="../lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="../lib/zTree/v3/js/jquery.ztree.all-3.5.min.js"></script> 
<script type="text/javascript" src="../static/h-ui/js/H-ui.js"></script> 
<script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script> 

</body>

<script type="text/javascript" src="../MyJs/date_string.js"></script>
<script type="text/javascript">
var page = 1;
var num=5;
var allnum=0;
window.onload=showInfo(page,num);

function select(){
		page=1;
		showInfo(page,num)
	}

function showInfo(page,num) {
	//获取误差天数，默认是2000
	var cxts=$("#cxts").val();
    
    $.getJSON('../scts.do',{"v":"my","d":cxts,"page":page,"num":num},function (data) {
    	$("#my > tbody").empty();
    	//遍历数据
    	$(data).each(function (i,v) {
    		var content="<tr class='text-c va-m'>";
    		content +="<td><input name='' type='checkbox' value=''></td>";
    		
    		content += "<td>"+v.my_name+"</td>";
    		content += "<td>"+v.my_yname+"</td>";
    		content += "<td>"+v.my_type+"</td>";
    		content += "<td>"+jsonDate_str(v.my_date)+"</td>";
    		
    		//jsonDate_str(v.my_date)
    		if(v.误差天数>0){
    			content += "<td>"+v.误差天数+"</td>";
    		}else{
    			content += "<td style='color:red;'><strong>"+(v.误差天数*-1)+"</strong></td>";
    		}
    		content += "<td>"+v.my_des+"</td>";
    		content += "<td>"+v.my_people+"</td>";
    		content +="</tr>";
    		var tp=v.总共条数;
    		allnum=tp;
    		$("#zonggongshuju").html(" 共有数据：<strong>"+allnum+"</strong> 条");
    		if(allnum%num==0){
    			$("#totalPage").html(parseInt(allnum/num));
    		}else{
    			$("#totalPage").html(parseInt(allnum/num)+1);
    		}
            $("#my > tbody").append(content);
            $("#pageCode").html(page);
           });
    });
}

//上一页
$("#ago").click(function(){
	if (page <= 1) {
		page = 1;
		
		return;
	}
	page = page - 1;
	$("#pageCode").html(page);
	showInfo(page,num);
});

//下一页
$("#next").click(function(){
	if(page>=$("#totalPage").html()){
		return;
	}
	page = page + 1;
	$("#pageCode").html(page);
	showInfo(page,num);
});
</script>
</html>